﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Kimola
{
  /// <summary>
  /// This is the single search result object returned from API.
  /// </summary>
  public class KResultItem
  {
    /// <summary>
    /// Gets or sets the document URL. This is the unique field which identifies all documents.
    /// </summary>
    /// <value>
    /// The URL of the document. Must be unique.
    /// </value>
    public string Url { get; set; }

    /// <summary>
    /// Gets or sets the title of the document.
    /// </summary>
    /// <value>
    /// The title of the document.
    /// </value>
    public string Title { get; set; }

    /// <summary>
    /// Gets or sets the document content.
    /// </summary>
    /// <value>
    /// The document content.
    /// </value>
    public string Content { get; set; }

    /// <summary>
    /// Gets or sets the document content in HTML format.
    /// </summary>
    /// <value>
    /// The document content.
    /// </value>
    public string HTMLContent { get; set; }

    /// <summary>
    /// Gets or sets the special fields as key-value pairs related to document if exists.
    /// A field's key or value text doesn't affect search results.
    /// Fields can be used to show additional information about the document when shown on UI.
    /// </summary>
    /// <value>
    /// Key values pairs
    /// </value>
    public Dictionary<string, string> Fields { get; set; }

    /// <summary>
    /// Gets or sets the automatically recognized phrases in the document. Each occurence of these strings can be replaced by a pre-search link in the UI layer.
    /// </summary>
    /// <value>
    /// The phrase array.
    /// </value>
    public string[] Phrases { get; set; }

    /// <summary>
    /// Gets or sets the document's date of creation. If left <paramref name="null"/>, it will be set to current <see cref="DateTime"/>.
    /// </summary>
    /// <value>
    /// The document date.
    /// </value>
    public DateTime DocumentDate { get; set; }
  }
}